[tests] Fix PlatformDetection.IsMonoInterpreter for mobile - #59587
Conversation
Checking for MONO_ENV_OPTIONS is not reliable for the mobile test runners because they use the embedding API to enable the interpreter, rather than setting an environment option. Instead detect the interpreter by checking the values of the IsDynamicCodeSupported and IsDynamicCodeCompiled runtime features.
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
|
Tagging subscribers to this area: @directhex Issue DetailsChecking for Instead detect the interpreter by checking the values of the Re-enable the Fixes #52460
|
| // This is a temporary solution because mono does not support interpreter detection | ||
| // within the runtime. | ||
| var val = Environment.GetEnvironmentVariable("MONO_ENV_OPTIONS"); | ||
| return (val != null && val.Contains("--interpreter")); |
There was a problem hiding this comment.
Can we also remove it from eng/pipelines/coreclr/templates/run-performance-job.yml and src/tests/Common/testenvironment.proj?
There was a problem hiding this comment.
I don't think so. We still need to set it when we're running on desktop platforms using Mono, since in that case we're just using the normal libraries test host.
The issue is just that it's not sufficient to check for the environment variable setting to detect whether we're using the interpreter. The RuntimeFeature checks should be accurate on all configurations, AFAIK.
these tests are not running on mono if they're running on .NET Framework
Checking for
MONO_ENV_OPTIONSis not reliable for the mobile test runners because they use the embedding API to enable the interpreter, rather than setting an environment variable.Instead detect the interpreter by checking the values of the
IsDynamicCodeSupportedandIsDynamicCodeCompiledruntime features.Re-enable the
System.Threading.Tasks.Dataflow.Teststestsuite on Apple platformsFixes #52460